<?php
// Make a MySQL Connection
mysql_connect("localhost", "admin", "") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());



// Create a MySQL table in the selected database

mysql_query("CREATE TABLE Artists
			(
                 	aname VARCHAR(30) NOT NULL,
                      type VARCHAR(30),
                      PRIMARY KEY(aname)
                  )
             "
            )  
or die(mysql_error());  

echo "Table Created!";


mysql_query("CREATE TABLE Concerts
			(
                 	cid INT NOT NULL AUTO_INCREMENT,
                      aname VARCHAR(30),
                      vname VARCHAR(30),
                      starttime DATETIME,
                      endtime DATETIME,
                      fee FLOAT,
                      PRIMARY KEY(cid)
                  )
             "
            )  
or die(mysql_error());  

echo "Table Created!";


mysql_query("CREATE TABLE Venues
			(
                      vname VARCHAR(30) NOT NULL, 
                      address VARCHAR(50),
                      phonenum VARCHAR(30),
                      PRIMARY KEY(vname)
                  )
             "
            )  
or die(mysql_error());  

echo "Table Created!";



mysql_query("CREATE TABLE ArtistGenre
			(
                      aname VARCHAR(30) NOT NULL, 
                      vname VARCHAR(30) NOT NULL, 
                      PRIMARY KEY(vname,aname)
                  )
             "
            )  
or die(mysql_error());  

echo "Table Created!";

?>